Skip to content

Conversation

@rafeca
Copy link
Contributor

@rafeca rafeca commented Jul 31, 2019

This PR adds the TypeScript definitions for the Dialog component, which were missing.

Merge checklist

  • Changed base branch to release branch
  • Add or update TypeScript definitions (index.d.ts) if necessary
  • Tested in Chrome
  • Tested in Firefox
  • Tested in Safari
  • Tested in Edge

export const theme: Object

export interface DialogProps extends CommonProps {
title: string
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

title can also be a React Node, but making it string | React.ReactNode causes an error since that's not compatible with the CommonProps title attribute.

To solve this I would need to change quite a bit the type definitions of CommonProps, BaseProps and probably the props of most of the components, let me know if it's worth it.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mxstbr do you know why title needs to be in CommonProps? https://github.com/primer/components/blob/master/index.d.ts#L9

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👋 Back from vacation now—probably because a tags can have a string title I would assume? That is copied from the rebass types if I remember correctly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@emplums I guess then that this PR should be fine to merge, and as a follow-up we can do the refactor of Props to support the title of a Dialog to be a React Node.

@emplums emplums changed the base branch from master to release-13.3.2 August 28, 2019 16:38
@emplums emplums merged commit 3d5bb83 into primer:release-13.3.2 Aug 28, 2019
@emplums emplums mentioned this pull request Aug 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants